#include "tcp_client.hpp"

int main(int argc,char* argv[])
{
	if(argc != 3)
	{
		std::cout<<"参数不足,----./client ip port"<<std::endl;
		return 1;
	}
	TcpClient client(argv[1],atoi(argv[2]));

	bool ret = client.Connect();
	if(!ret)
		return 1;
	while(1)
	{
		std::cout<<"请输入要查询的单词："<<std::endl;
		std::string word;
		std::cin>>word;

		client.Send(word);
		std::string result;
		client.Recv(&result);
		std::cout<<result<<std::endl;
	}
	return 0;
}
